/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.wxrobot.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 活动客户信息Entity
 * @author laozhang
 * @version 2018-07-31
 */
@Table(name="tb_customer", alias="a", columns={
		@Column(name="id", attrName="id", label="主键", isPK=true),
		@Column(name="activity_id", attrName="activityId", label="活动id"),
		@Column(name="self_code", attrName="selfCode", label="用户专属码", comment="用户专属码(邀请他人)"),
		@Column(name="weixin_user_name", attrName="weixinUserName", label="微信用户名", comment="微信用户名(用于发送微信消息)", queryType=QueryType.LIKE),
		@Column(name="avatar", attrName="avatar", label="头像"),
		@Column(name="nick_name", attrName="nickName", label="昵称", queryType=QueryType.LIKE),
		@Column(name="invitation_code", attrName="invitationCode", label="邀请码", comment="邀请码(他人专属码)"),
		@Column(name="sub_num", attrName="subNum", label="下级数量"),
		@Column(name="robot", attrName="robot", label="是否机器人1-是|0-否"),
		@Column(name="remark_name", attrName="remarkName", label="备注名"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.sub_num DESC"
)
public class Customer extends DataEntity<Customer> {
	
	private static final long serialVersionUID = 1L;
	private String activityId;		// 活动id
	private String selfCode;		// 用户专属码(邀请他人)
	private String weixinUserName;		// 微信用户名(用于发送微信消息)
	private String avatar;		// 头像
	private String nickName;		// 昵称
	private String invitationCode;		// 邀请码(他人专属码)
	private Long subNum;		// 下级数量
	private Integer robot;		// 是否机器人1-是|0-否
	private String remarkName; //备注名
	
	public Customer() {
		this(null);
	}

	public Customer(String id){
		super(id);
	}
	
	@NotBlank(message="活动id不能为空")
	@Length(min=0, max=64, message="活动id长度不能超过 64 个字符")
	public String getActivityId() {
		return activityId;
	}

	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}
	
	@NotBlank(message="用户专属码不能为空")
	@Length(min=0, max=20, message="用户专属码长度不能超过 20 个字符")
	public String getSelfCode() {
		return selfCode;
	}

	public void setSelfCode(String selfCode) {
		this.selfCode = selfCode;
	}
	
	@Length(min=0, max=64, message="微信用户名长度不能超过 64 个字符")
	public String getWeixinUserName() {
		return weixinUserName;
	}

	public void setWeixinUserName(String weixinUserName) {
		this.weixinUserName = weixinUserName;
	}
	
	@Length(min=0, max=255, message="头像长度不能超过 255 个字符")
	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	
	@NotBlank(message="昵称不能为空")
	@Length(min=0, max=200, message="昵称长度不能超过 200 个字符")
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	@Length(min=0, max=20, message="邀请码长度不能超过 20 个字符")
	public String getInvitationCode() {
		return invitationCode;
	}

	public void setInvitationCode(String invitationCode) {
		this.invitationCode = invitationCode;
	}
	
	public Long getSubNum() {
		return subNum;
	}

	public void setSubNum(Long subNum) {
		this.subNum = subNum;
	}
	
	@NotNull(message="是否机器人1-是|0-否不能为空")
	public Integer getRobot() {
		return robot;
	}

	public void setRobot(Integer robot) {
		this.robot = robot;
	}

	public String getRemarkName() {
		return remarkName;
	}

	public void setRemarkName(String remarkName) {
		this.remarkName = remarkName;
	}
}